<!DOCTYPE html>
<html>
	<head>
		<title>Sylveo admin</title>
		<meta http-equiv="Content-Type" content="UTF-8"/>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
		<script src="/socket.io/socket.io.js"></script>
		<script type="text/javascript">
			
		var socket = io.connect();

		socket.on('deviceConnected', function (data) {
			socket.emit('setDevice', {
				device: 'admin'
			});
		});

		socket.on('changeState', function (data) {
			console.log(data.changeState);
		});

		function dispatchChangeState(newState){
			socket.emit('changeState', {
				newState: newState
			});
		}



		</script>
	</head>
	<body>
		<div class="container">
			<h1>Admin Sylveo</h1>

			<br/>

			<h2>Lancement</h2>
			<button onClick="dispatchChangeState('opening')" class="btn btn-inverse">Start</button>
			<button onClick="dispatchChangeState('bluetooth')" class="btn btn-inverse">Synchronisation</button>
			<button onClick="dispatchChangeState('tutorial')" class="btn btn-inverse">Tutorial</button>
			<button onClick="dispatchChangeState('visioCall')" class="btn btn-inverse">Appel Visio</button>
			
			<h2>Aventure</h2>
			<button onClick="dispatchChangeState('tutoDefiHome')" class="btn btn-inverse">Chapitre 2 : Le photographe</button>
			<button onClick="dispatchChangeState('tutoDefiQuizz')" class="btn btn-inverse">Chapitre 7 : Quizz</button>
			<button onClick="dispatchChangeState('tutoRA')" class="btn btn-inverse">Chapitre 13 : Ugres</button>
			<button onClick="dispatchChangeState('tutoDefiHotCold')" class="btn btn-inverse">Chapitre 16 : Chaud Froid</button>

			<h2>Fin</h2>
			<button onClick="dispatchChangeState('tutoPuzzle')" class="btn btn-inverse">Chapitre 20 : Le tresor</button>
			<button onClick="dispatchChangeState('treasureFound')" class="btn btn-inverse">Deterrer le tresor</button>
			<button onClick="dispatchChangeState('end-book')" class="btn btn-inverse">Replay</button>
			<button onClick="dispatchChangeState('photoFinish')" class="btn btn-inverse">Photo Finish</button>
		</div>

	</body>
</html>